import request from '@/utils/request'

/**
 * 1. 获取所有数据文件
 */
export function getAllDataFile() {
  return request({
    url: '/standards/dataFile/list',
    method: 'get'
  })
}

/**
 * 2. 审核数据状态
 */
export function auditDataFileStatus(id, newStatus,remark) {
  return request({
    url: '/standards/dataFile/audit/' +id+ '/' + newStatus + '/' + remark,
    method: 'put',
  })
}

/**
 * 15. 修改数据文件备注
 */
export function updateDataFileRemark(id,remark) {
  return request({
    url: '/standards/dataFile/updateRemark/' +id+ '/' + remark,
    method: 'put',
  })
}

/**
 * 3. 删除数据文件
 */
// export function delDataFile(ids) {
//   return request({
//     url: '/standards/dataFile/' + ids,
//     method: 'delete'
//   })
// }

/**
 * 4. 查询数据文件列表-- 条件查询
 */
export function getListDataFile(query) {
  return request({
    url: '/standards/dataFile/list',
    method: 'get',
    params: query
  })
}

/**
 * 5. 获取所有 数据操作日志
 */
export function getLogData(dataName) {
  return request({
    url: '/standards/dataFile/operLog/'+dataName,
    method: 'get'
  })
}

/**
 * 6. 插入 数据操作日志
 */
export function insertLogData(data) {
  return request({
    url: '/standards/dataFile/operLog',
    method: 'post',
    data: data
  })
}

/**
 * 8. 查询数据文件详细 by id
 */
export function getDataFileInfo(id) {
  return request({
    url: '/standards/dataFile/' + id,
    method: 'get'
  })
}

/**
 * 9. 查询数据文件详细 by dataName
 */
export function getDataFileInfoByName(jsonData) {
  return request({
    url: '/standards/dataFile/dataName',
    method: 'post',
    data:jsonData
  })
}

/**
 * 11.  删除数据操作日志  by dataName
 */
export function deleteDataOperLogByDataName(dataName) {
  return request({
    url: '/standards/dataFile/operLog/' + dataName,
    method: 'delete'
  })
}

/**
 * 12.  删除数据  by id
 */
export function delDataFileById(id) {
  return request({
    url: '/standards/dataFile/' + id,
    method: 'delete'
  })
}

/**
 *  14. 合并 filesPath by standardCode
 */
export function mergeFilesPath(standardCode) {
  return request({
    url: '/standards/dataFile/mergeFilesPath/' + standardCode,
    method: 'get'
  })
}
